<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>分期付款贷款计算器</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="calculator">
        <h1>分期付款贷款计算器</h1>
        <form id="loanCalculator">
            <label for="loanAmount">贷款金额:</label>
            <input type="number" id="loanAmount" name="loanAmount" required><br><br>

            <label for="interestRate">年利率 (%):</label>
            <input type="number" id="interestRate" name="interestRate" required><br><br>

            <label for="loanTerm">贷款期限 (年):</label>
            <input type="number" id="loanTerm" name="loanTerm" required><br><br>

            <button type="button" onclick="calculate()">计算</button>
        </form>

        <div id="results">
            <h2>计算结果:</h2>
            <p id="monthlyPayment">每月还款额: <span></span></p>
            <p id="totalPayment">总还款额: <span></span></p>
            <p id="totalInterest">总利息: <span></span></p>
        </div>
    </div>

    <script src="script.js"></script>
</body>
</html>